package com.zdsoft.blp.zongbuju.shouye.wuye.adapter;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.zdsoft.blp.R;
import com.zdsoft.blp.gongyong.application.MyApp;
import com.zdsoft.blp.gongyong.imageTrans.CircleImage;
import com.zdsoft.blp.zongbuju.shouye.taoshihui.entity.FenLei;

import java.util.List;

/**
 * Created by pc on 2016/9/3.
 */
public class GridAdapter extends BaseAdapter{
    private List<Bitmap> list;
    private Context mContext;

    public GridAdapter(List<Bitmap> list, Context mContext) {
        this.list = list;
        this.mContext = mContext;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            holder=new ViewHolder();
            convertView = LayoutInflater.from(mContext).inflate(R.layout.wu_gridviewitem, null);
            holder.iv = (ImageView) convertView.findViewById(R.id.iv);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.iv.setImageBitmap(list.get(position));
        return convertView;
    }

    class ViewHolder {
        ImageView iv;
    }
}
